{# /mp read.html #}
{% extends "template.html" %}

{% block conn %}
{%autoescape off%}
	<div class="part list">
		{% include "list_msg.html" %}
	</div>

	<div class="part msg">
		<fieldset id="msg">
			<legend>Lecture du Message</legend>

			<form method="get" action="/{{type}}" >
				<input type="hidden" name="to" value="{{to}}" />
				<input type="hidden" name="sub" value="{{sub}}" />
				<input type="hidden" name="cite" value="{{cite}}" />
				<input type="hidden" name="thread" value="{{thread.key}}"/>
				<input type="submit" value="répondre" {%if not send%}class="small">{%endif%}
		   	</form>
			{%if not send%}<form method="get" action="/packing" >
				<input type="hidden" value="{{thread.key}}" name="read" />
				<select name="cat" class="setCat">
					<option value="not">Non lu</option>
					<option value="read">Lu</option>
					<option value="pack" selected="selected">Archiver</option>
					<option value="bann">tag bannis</option>
					<option value="warn">tag danger</option>
				</select>
				<input type="submit" value="✔" class="setTick" /></form>{%endif%}
				{%if mp|length > 2%}<a href="#msg-last" class="fake-submit">Aller au dernier message</a>{%endif%}
			<hr />

			{% for m in mp %}
			<h2{%if forloop.last%} id="msg-last"{%endif%}>{%firstof m.subject thread.subject%}
				<span style="display:none;" class="secure">{{m.secure}}</span>
			</h2>
			<p>{{ m.message|render|linebreaksbr}}</p>
			<h3>{{m.author}}, {{ m.date|render_date}}</h3>
			<hr />
			{% endfor %}

			<form method="get" action="/{{type}}" >
				<input type="hidden" name="to" value="{{to}}" />
				<input type="hidden" name="sub" value="{{sub}}" />
				<input type="hidden" name="cite" value="{{cite}}" />
				<input type="hidden" name="thread" value="{{thread.key}}"/>
				<input type="submit" value="répondre" {%if not send%}class="small"{%endif%}/>
			</form>
			{%if not send%}<form method="get" action="/packing" >
				<input type="hidden" value="{{thread.key}}" name="read" />
				<select name="cat" class="setCat">
					<option value="not">Non lu</option>
					<option value="read">Lu</option>
					<option value="pack" selected="selected">Archiver</option>
					<option value="bann">tag bannis</option>
					<option value="warn">tag danger</option>
				</select>
				<input type="submit" value="✔" class="setTick" /></form>{%endif%}
		</fieldset>
	</div>
{%endautoescape%}
{% endblock conn %}

